#!/bin/bash
root_dir=/usr/local/edata
echo "$(date +"%Y-%m-%d %H:%M:%S") INFO uninstall is running..."
echo "$(date +"%Y-%m-%d %H:%M:%S") INFO checking kafka mode..."
running_mode=$(cat mode)
echo "$(date +"%Y-%m-%d %H:%M:%S") INFO current mode of kafka is $running_mode"
echo "$(date +"%Y-%m-%d %H:%M:%S") INFO remove $root_dir/kafka"
rm mode
rm node_id
rm cluster_id
rm -rf $root_dir/kafka
if [[ $? -eq 0 ]];then
  echo "$(date +"%Y-%m-%d %H:%M:%S") INFO kafka uninstall success"
else
  echo "$(date +"%Y-%m-%d %H:%M:%S") ERROR kafka uninstall error"
fi